﻿<%@ Page Title="" Language="C#" MasterPageFile="~/views/admin/AdminMaster.master" AutoEventWireup="true" CodeFile="sp4.aspx.cs" Inherits="sp4" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MyContent" Runat="Server">
    <div class="container-fluid">
       <div class="row">
           <div class="col">
               <h3 class="text-center" style="color: white">分类查看</h3>

           </div>
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" PageSize="6" BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" DataKeyNames="Producttypeid" DataSourceID="LinqDataSource1" ForeColor="Black" GridLines="Vertical">
        <AlternatingRowStyle BackColor="#CCCCCC" />
        <Columns>
            <asp:CommandField HeaderText="选择" ShowSelectButton="True" />
            <asp:BoundField DataField="Producttypeid" HeaderText="类别ID" ReadOnly="True" SortExpression="Producttypeid" />
            <asp:BoundField DataField="typename" HeaderText="类别名称" SortExpression="typename" />
            <asp:BoundField DataField="typems" HeaderText="类别描述" SortExpression="typems" />
        </Columns>
        <FooterStyle BackColor="#CCCCCC" />
        <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F1F1F1" />
        <SortedAscendingHeaderStyle BackColor="#808080" />
        <SortedDescendingCellStyle BackColor="#CAC9C9" />
        <SortedDescendingHeaderStyle BackColor="#383838" />
    </asp:GridView>
    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" DataKeyNames="ProductID" DataSourceID="LinqDataSource2" ForeColor="Black" GridLines="Vertical">
        <AlternatingRowStyle BackColor="#CCCCCC" />
        <Columns>
            <asp:BoundField DataField="ProductID" HeaderText="商品编号" InsertVisible="False" ReadOnly="True" SortExpression="ProductID" />
            <asp:BoundField DataField="ProductName" HeaderText="商品名称" SortExpression="ProductName" />
            <asp:BoundField DataField="ProductPrice" HeaderText="商品价格" SortExpression="ProductPrice" />
            <asp:BoundField DataField="ProductDescription" HeaderText="商品描述" SortExpression="ProductDescription" />
            <asp:BoundField DataField="ProductStock" HeaderText="库存" SortExpression="ProductStock" />
            <asp:BoundField DataField="MerchantID" HeaderText="供应商ID" SortExpression="MerchantID" />
            <asp:BoundField DataField="Producttypeid" HeaderText="类别id" SortExpression="Producttypeid" />
            <asp:ImageField DataAlternateTextField="ProductImage" DataImageUrlField="ProductImage" HeaderText="图片">
                <ControlStyle Height="300px" Width="350px" />
            </asp:ImageField>
        </Columns>
        <FooterStyle BackColor="#CCCCCC" />
        <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F1F1F1" />
        <SortedAscendingHeaderStyle BackColor="#808080" />
        <SortedDescendingCellStyle BackColor="#CAC9C9" />
        <SortedDescendingHeaderStyle BackColor="#383838" />
    </asp:GridView>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="PJTY.dal.DataClasses1DataContext" EntityTypeName="" TableName="Producttype">
    </asp:LinqDataSource>
    <asp:LinqDataSource ID="LinqDataSource2" runat="server" ContextTypeName="PJTY.dal.DataClasses1DataContext" EntityTypeName="" TableName="Product1" Where="Producttypeid == @Producttypeid">
        <WhereParameters>
            <asp:ControlParameter ControlID="GridView1" DefaultValue="1" Name="Producttypeid" PropertyName="SelectedValue" Type="Int32" />
        </WhereParameters>
    </asp:LinqDataSource>
</asp:Content>

